One example of the I/O device sharing system is described in PTL 1. The I/O device sharing system shown in FIG. 7 includes a plurality of hosts (hereinafter, these hosts are described as a host 2-1 (a host 1), a host 2-2 (a host 2), . . . , and a host 2-N (a host N)), an I/O device 5 corresponding to SR-IOV, an I/O virtual bridge 6, and a network 3. The I/O device 5 corresponding to SR-IOV conforms to the Single-Root I/O Virtualization (SR-IOV) standard shared by the hosts 2-1 to 2-N. The I/O virtual bridge 6 virtualizes the I/O device 5 corresponding to SR-IOV. The network 3 connects the hosts 2-1 to 2-N and the I/O virtual bridge 6.
The host 2-1 includes a CPU 201-1, a memory 203-1, a host PCIe bridge 204-1, and a route complex 202-1. The CPU 201-1 operates according to a program. The memory 203-1 stores the program and data. The host PCIe bridge 204-1 connects a PCI Express (PCIe) bus that is an I/O bus of the host 2-1 and the network 3. The route complex 202-1 connects the CPU 201-1, the memory 203-1, and the host PCIe bridge 204-1 to each other. The host PCIe bridge 204-1 encapsulates a PCIe packet in a network packet and decapsulates the PCIe packet encapsulated in the network packet. All the hosts 2-1 to 2-N have the same configuration.
The I/O device 5 corresponding to SR-IOV holds a Physical Function (PF) 501 that is an interface for controlling the device and a plurality of Virtual Functions (VFs) that are interfaces to provide the function of the I/O device. Hereinafter, a plurality of the VFs are described as the VF 502-1 (VF1) to the VF 502-N (VFN). The PF 501 holds a PF configuration register (PF_CFG_REG) 5011 for setting the PF 501. The VF 502-1 is used by the host 2-1. Similarly, the VFs 502-2 to 502-N are used by the hosts 2-2 to 2-N, respectively. Accordingly, the I/O device 5 corresponding to SR-IOV is shared by the hosts 2-1 to 2-N.
The I/O virtual bridge 6 includes a network connection unit 601 which transmits/receives the PCIe packet to/from the network 3, a packet transfer unit 602 which transfers the PCIe packet, an address conversion unit 603 which performs conversion of a destination address of the PCIe packet, and a connection virtualization unit 604 which performs a setting of the I/O device 5 corresponding to SR-IOV.
The network connection unit 601 decapsulates the PCIe packet that is encapsulated in the packet of the network 3. The network connection unit 601 encapsulates the PCIe packet in the packet of the network 3 and transmits it to the network 3.
The connection virtualization unit 604 accesses the PF_CFG_REG 5011 and performs the setting of the I/O device 5 corresponding to SR-IOV before the I/O device 5 corresponding to SR-IOV is used by the hosts 2-1 to 2-N. At this time, the address of the I/O device 5 corresponding to SR-IOV is set.
The address conversion unit 603 converts the address of the PCIe packet with respect to the access from the hosts 2-1 to 2-N to the I/O device 5 corresponding to SR-IOV. Specifically, the address conversion unit 603 performs the address conversion in which the addresses of the VFs 502-1 to 502-N that are set by the hosts 2-1 to 2-N are converted into the addresses of the VFs 502-1 to 502-N that are set by the connection virtualization unit 604, respectively.
The I/O device sharing system having the above-mentioned configuration operates as follows.
In the following explanation, a case in which the host 2-1 accesses the VF 502-1 will be explained as an example. The following explanation can be applied to a case in which the hosts 2-2 to 2-N access the VFs 502-2 to 502-N, respectively. When the CPU 201-1 which operates according to software in the host 1 issues an instruction to access the VF 502-1, the route complex 202-1 creates the PCIe packet addressed to a memory address to which the VF 502-1 is mapped and transmits it. The host PCIe bridge 204-1 encapsulates the PCIe packet in the network packet and transmits it to the network 3. The network connection unit 601 receives the network packet, decapsulates the PCIe packet, and transfers it to the packet transfer unit 602.
The packet transfer unit 602 transfers the received PCIe packet to the address conversion unit 603. The address conversion unit 603 converts the destination address designated by the host 2-1 into the address of the VF 502-1 that is set to the PF 501 by the connection virtualization unit 604 and transmits the PCIe packet to the VF 502-1. As a result, the VF 502-1 receives the PCIe packet issued by the host 2-1. Further, when the host 2-1 receives the PCIe packet transmitted by the VF 502-1, the above-mentioned processes are performed in reverse order.